import globals from 'globals';
import pluginJs from '@eslint/js';
import pluginVue from 'eslint-plugin-vue';
import eslintConfigPrettier from 'eslint-config-prettier';

export default [
  { files: ['**/*.{js,mjs,cjs,vue}'] },
  { languageOptions: { globals: globals.browser } },
  {
    //  ESLint 配置忽略的文件
    ignores: [
      'node_modules/', // 忽略 node_modules 目录
      'dist/',
      'package-lock.json',
      'package.json',
      '.vscode/',
    ],
  },
  pluginJs.configs.recommended,
  ...pluginVue.configs['flat/essential'],
  {
    // "off", 0; "warn", 1; "error", 2
    rules: {
      'no-debugger': 1,
      'no-var': 1,
      'no-console': 1,
    },
  },
  eslintConfigPrettier,
];
